<template>
    <Form ref="form" :formData="formData" />
    <button class="btn-submit" @click="submit">提交</button>
</template>

<script>
import { defineComponent, ref, reactive, toRefs } from 'vue'
import Form from '@/components/Form'

export default defineComponent({
    name: 'AddUser',
    components: { Form },
    setup() {
        const data = reactive({
            formData: {
                oneLabel: '公司名称',
                twoLabel: '销售区域',
                oneInput: '请输入公司名称',
                twoInput: '请选择销售区域',
                username: '',
                password: '',
                type: 'text',
                color: 'red',
                isRead: true
            }
        })
        const form = ref(null)
        const submit = () => {
            form.value.chekAllValue('addUser')
        }
        return {
            form,
            ...toRefs(data),
            submit
        }
    }
})
</script>

<style scoped lang="scss">
.btn-submit {
    width: 100%;
    height: 45px;
    margin-top: 10px;
    font-size: 16px;
    color: white;
    text-align: center;
    background-color: #068878;
    border: none;
    border-radius: 12px;
    outline: none;
}
</style>
